package cn.bearspark.api.controller.func;

import cn.bearspark.api.service.func.ForwardService;
import cn.bearspark.api.vo.func.forward.HappeningReqVO;
import cn.bearspark.framework.web.starter.vo.ResponseVO;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 转发模块
 *
 * @author f
 */
@Validated
@RestController
@RequestMapping("/forward")
public class ForwardController {

    private final ForwardService forwardService;

    public ForwardController(ForwardService forwardService) {
        this.forwardService = forwardService;
    }

    /**
     * 转发动态
     *
     * @param happeningReqVO 转发动态的请求对象
     * @return 响应对象
     */
    @PostMapping("/happening")
    public ResponseVO<Object> forwardHappening(@Valid @RequestBody HappeningReqVO happeningReqVO) {
        forwardService.forwardHappening(happeningReqVO);
        return ResponseVO.success();
    }

}
